﻿@model JT.WEB.Views.PaginatedList<JT.WEB.Models.Were.TbChuRuInfo>
<!-- Modal -->
<!-- <partial name="Create" /> -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
     aria-hidden="true">
    <form asp-action="Create">
        <div class="modal-dialog" role="document">

            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">增加出入信息</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-12">


                            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
                            @*<div class="form-group">
                                <label asp-for="tbChuRuInfo.NamePerson" class="control-label"></label>
                                <select asp-for="tbChuRuInfo.NamePerson" class="form-control" asp-items="ViewBag.NamePerson"></select>
                            </div>*@
                            <div class="form-group">
                                <label asp-for="tbChuRuInfo.ItemNameId" class="control-label"></label>
                                <input asp-for="tbChuRuInfo.ItemNameId" class="form-control" list="itemName" />
                                <datalist id="itemName">
                                    @foreach (var item in ViewBag.ItemName)
                                    {
                                    <option value="@item.NameId">@item.ItemName</option>
                                    }
                                </datalist>

                                <span asp-validation-for="tbChuRuInfo.ItemNameNavigation.ItemName" class="text-danger"></span>
                            </div>
                            <div class="form-group">
                                <label asp-for="tbChuRuInfo.Count" class="control-label"></label>
                                <input asp-for="tbChuRuInfo.Count" class="form-control" value="0" />
                                <span asp-validation-for="tbChuRuInfo.Count" class="text-danger"></span>
                            </div>
                            <div class="form-group">
                                <label asp-for="tbChuRuInfo.ChangeDate" class="control-label"></label>
                                <input asp-for="tbChuRuInfo.ChangeDate" class="form-control" id="date_info" />

                                <style>
                                    input[type=datetime-local]::-webkit-inner-spin-button {
                                        visibility: hidden;
                                    }
                                </style>
                                <script>
                                    var today = new Date();
                                    var yyyy = today.getFullYear();
                                    var MM = today.getMonth() + 1;
                                    var dd = today.getDate();
                                    var hh = today.getHours();
                                    var mm = today.getMinutes();
                                    MM = checkTime(MM);
                                    dd = checkTime(dd);
                                    hh = checkTime(hh);
                                    mm = checkTime(mm);
                                    var time = yyyy + "-" + MM + "-" + dd + "T" + hh + ":" + mm;
                                    var dateControl = document.querySelector("#date_info");
                                    dateControl.value = time;
                                    function checkTime(i) {
                                        if (i < 10) {
                                            i = "0" + i;
                                        }
                                        return i;
                                    }
                                </script>
                                <span asp-validation-for="tbChuRuInfo.ChangeDate" class="text-danger"></span>
                            </div>
                            <div class="form-group">
                                <div class="radio">
                                    <label>
                                        <input asp-for="tbChuRuInfo.IsRuKu" type="radio" checked="checked" value="1" /> 入库
                                    </label>
                                    <label>
                                        <input asp-for="tbChuRuInfo.IsRuKu" type="radio" value="0" /> 出库
                                    </label>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                                <button type="submit" class="btn btn-outline-success">保存</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </form>
</div>

<!-- 增加出入信息 -->

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}


